﻿using System;
using System.IO;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;

namespace ERP.UI.SystemAdministrator
{
	public partial class EditAdministratorCredentials
	{
		public EditAdministratorCredentials()
		{
			this.InitializeComponent();
			
			// Insert code required on object creation below this point.
		}

        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            //lblPasswordError.Visibility = lblConfirmPasswordError.Visibility = lblSavedSuccessfully.Visibility = lblCannotSaveError.Visibility = Visibility.Hidden;
            //if (tbNewPassword.Password.Trim().Equals(string.Empty))
            //    lblPasswordError.Visibility = Visibility.Visible;
            //else if (!tbNewPasswordConfirm.Password.Trim().Equals(tbNewPassword.Password.Trim(), StringComparison.CurrentCulture))
            //    lblConfirmPasswordError.Visibility = Visibility.Visible;
            //else
            //{
            //    if (ERP.Buissness.Helpers.WorkflowAccessors.UsersManagers.CredentialsManager.ChangeAdminCredentials(tbNewUsername.Text.Trim(),
            //        tbNewPassword.Password.Trim()))
            //    {
            //        lblSavedSuccessfully.Visibility = Visibility.Visible;
            //        btnSave.IsEnabled = false;
            //    }
            //    else
            //    {
            //        lblCannotSaveError.Visibility = Visibility.Visible;
            //        btnSave.IsEnabled = false;
            //    }
            //}
        }

        private void ButtonCancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
	}
}